<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateFictionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('fiction', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->text('cover')->comment('封面');
            $table->string('title',50)->comment('作品标题');
            $table->string('content')->comment('内容介绍');
            $table->string('catalogue')->comment('书目录');
            $table->string('author',30)->comment('作者');
            $table->string('type',30)->comment('类型');
            $table->string('number',15)->comment('字数量');
            $table->string('reading',15)->comment('阅读量');
            $table->string('collection',15)->comment('收藏量');
            $table->enum('status',['已完结','连载中'])->comment('状态');
            $table->timestamps();
            $table->softDeletes();
            $table->engine = 'InnoDB';
            $table->charset = 'utf8mb4';
            $table->collation = 'utf8mb4_general_ci';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('fiction');
    }
}
